package com.youngwang.system.runtime;

import com.youngwang.join.JoinerTest;
import org.springframework.util.ObjectUtils;

import java.io.Console;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author youngwang
 *         Date: 2016/8/31
 */
public class SystemTest {

    public static void main(String[] args) throws ParseException{
        System.out.println(JoinerTest.join(System.getProperties().stringPropertyNames(), "--"));
        // System.out.print(System.getSecurityManager().toString());
        Long currentTimeMillis = System.currentTimeMillis();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String d = format.format(currentTimeMillis);
        Date date = format.parse(d);
        System.out.print(date);
        Console console = System.console();
        if (!ObjectUtils.isEmpty(console)) {
            System.out.print(System.console().printf("Hello"));
        }
    }

}
